<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>用户注册</title>
<link type="text/css" rel="stylesheet"
	href="/products/passport/v2/css/base.css" />
<link type="text/css" rel="stylesheet"
	href="/products/passport/v2/css/register.css" />
<!--[if lte IE 6]>
<script src="http://stc1.kongzhong.com/passport/v2/js/png.js" type="text/javascript"></script>
<script type="text/javascript">
	DD_belatedPNG.fix('div,span,img,li,.tabs a,.tabs p');
</script>
<![endif]-->
<link rel="shortcut icon" href="favicon.ico"   type="image/x-icon" />
</head>
<body class="regbg">
	<div class="reg_main">
		<!--头部-->
		<div class="reg_main_header">
			<div class="reg_logo"></div>
			<div class="info">
				已有乐控科技账号，立即<a href="/products/login">登录</a>&nbsp;|&nbsp;<a
					target="_blank" href="/products/index">返回首页</a>
			</div>
		</div>
		<!--内容-->
		<div class="reg_main_content">
			<!--左侧-->
			<div class="left_main">
				<span class="reg_left_tip"></span>
				<div class="tabs">
					<a class="${m =='toregphone'?'click':'link'}"
						href="/products/regist?m=toregphone">
						<p class="m_ico_link">手机账号注册</p>
						<p class="p_link">独享手机靓号，安全有保障</p>
					</a> <a class="${m =='toregemail'?'click':'link'}"
						href="/products/regist?m=toregemail">
						<p class="e_ico_link">邮箱账号注册</p>
						<p class="p_link">常用邮箱注册，方便易记忆</p>
					</a> <a class="${m =='toregnickname'?'click':'link'}"
						href="/products/regist?m=toregnickname">
						<p class="g_ico_link ">个性账号注册</p>
						<p class="p_link">任意选择您喜欢的账号名称</p>
					</a>
				</div>
			</div>

			<form id="register_frm" method="post"
				action="/products/acc?registerType=${m}">
				<!--右侧-->
				<div class="rightMain">
					<div class="right_wrapper">
						<c:if test="${!empty secondStep  }">
							<div id="EmailRegSteptwo" style="display: block;">
								<div class="tablebox">
									<input type="hidden" name="user" id="useraccount"
										value="${secondStep }" />
									<!--验证邮箱-->
									<p class="tips_thanks">还差一步就完成注册了</p>
									<p class="tips_check1">为保护您的邮箱账号不被他人使用，我们已经给您的邮箱${secondStep }发送了一封确认邮件，请在收到邮件后，点击邮件中的空中网账号激活的确认链接即可。</p>
									<p class="btnReSend">
										<a href="http://mail.${emailServer }.com" target="_blank"
											class="btn_11"><span>立即去我的邮箱确认</span></a>
									</p>
								</div>
								<div class="reg_line">
									<p class="tips_notes">
										<strong>温馨提示：</strong><br /> 1.
										如果收件箱中找不到我们发送的邮件，请稍候片刻或者检查您的垃圾邮件。<br /> 2. 如果5分钟未收到邮件，请点击<a
											style="cursor:pointer" id="resendemail"
											class="reg_email_send">重新发送邮件</a><br /> 3.
										如果重新发送邮件后还长时间未收到邮件，请<a class="fblue"
											href="/products/regist?m=toregemail">换个邮箱试试</a>！
									</p>
								</div>
							</div>
						</c:if>
						<c:if test="${empty secondStep }">
							<c:if test="${registerType==1}">
								<div class="t_line">
									<div class="l_list wone_zc1">个性帐号：</div>
									<div class="r_list wtwo_zc1">
										<div class="input_text">
											<input id="useraccount" maxlength="16" name="useraccount"
												value="" type="input">
										</div>
										<div id="useraccountTip"></div>
									</div>
								</div>
								<div class="t_line">
									<div class="l_list wone_zc1">设置密码：</div>
									<div class="r_list wtwo_zc1 init_lineheight">
										<div class="input_text">
											<input id="password" name="password" maxlength="16"
												type="password" class="password_adv" onpaste="return false"
												oncontextmenu="return false" oncopy="return false"
												oncut="return false" autocomplete="off" kztype="pwd">
										</div>
										<div id="passwordTip"></div>
									</div>
								</div>
								<div class="t_line">
									<div class="l_list wone_zc1">确认密码：</div>
									<div class="r_list wtwo_zc1">
										<div class="input_text">
											<input id="password2" name="password2" maxlength="16"
												type="password" onpaste="return false"
												oncontextmenu="return false" oncopy="return false"
												oncut="return false">
										</div>
										<div id="password2Tip"></div>
									</div>
								</div>
								<div class="t_line">
									<div class="l_list wone_zc1">验证码：</div>
									<div class="r_list wtwo_zc1">
										<input id="verif_code" name="vcode" maxlength="4" type="input"
											class="vali_text" kztype="captcha">
										<div id="verif_codeTip"></div>
									</div>
								</div>
							</c:if>
							<c:if test="${registerType==2}">
								<div>

									<div class="t_line">
										<div class="l_list wone_zc1">手机号码：</div>
										<div class="r_list wtwo_zc1">
											<div class="input_text">
												<input id="useraccount" name="useraccount" value=""
													type="input" maxlength="11" class="dis-ime-mode">
											</div>
											<div id="useraccountTip"></div>
										</div>
									</div>
									<div class="t_line">
										<div class="l_list wone_zc1">短信验证码：</div>
										<div class="r_list wtwo_zc1" style="position:relative;">
											<div class="input_text">
												<input id="vcode" name="vcode" type="text"
													class="dis-ime-mode" maxlength="6">
											</div>
											<input type="button" id="sms_code_btn" value="获取验证码"
												class="txtCenter getVali">
											<div id="vcodeTip"></div>
										</div>
									</div>
									<div class="t_line">
										<div class="l_list wone_zc1">设置密码：</div>
										<div class="r_list wtwo_zc1 init_lineheight">
											<div class="input_text">
												<input id="password" name="password" kztype="pwd"
													maxlength="16" type="password" class="password_adv"
													onpaste="return false" oncontextmenu="return false"
													oncopy="return false" oncut="return false"
													autocomplete="off">
											</div>
											<div id="passwordTip"></div>
										</div>
									</div>

									<div class="t_line">
										<div class="l_list wone_zc1">确认密码：</div>
										<div class="r_list wtwo_zc1">
											<div class="input_text">
												<input id="password2" name="password2" maxlength="18"
													type="password" onpaste="return false"
													oncontextmenu="return false" oncopy="return false"
													oncut="return false">
											</div>
											<div id="password2Tip"></div>
										</div>
									</div>
								</div>
							</c:if>
							<c:if test="${registerType==3}">
								<div id="EmailRegStepone">
									<div class="t_line">
										<div class="l_list wone_zc1">电子邮箱：</div>
										<div class="r_list wtwo_zc1">
											<div class="input_text">
												<input id="useraccount" name="useraccount" maxlength="30"
													type="text" value="">
											</div>
											<div id="useraccountTip"></div>
										</div>
									</div>
									<div class="t_line">
										<div class="l_list wone_zc1">设置密码：</div>
										<div class="r_list wtwo_zc1 init_lineheight">
											<div class="input_text">
												<input id="password" name="password" kztype="pwd"
													maxlength="16" type="password" class="password_adv"
													onpaste="return false" oncontextmenu="return false"
													oncopy="return false" oncut="return false"
													autocomplete="off">
											</div>
											<div id="passwordTip"></div>
										</div>
									</div>
									<div class="t_line">
										<div class="l_list wone_zc1">确认密码：</div>
										<div class="r_list wtwo_zc1">
											<div class="input_text">
												<input id="password2" name="password2" maxlength="18"
													type="password" onpaste="return false"
													oncontextmenu="return false" oncopy="return false"
													oncut="return false">
											</div>
											<div id="password2Tip"></div>
										</div>
									</div>
									<div class="t_line">
										<div class="l_list wone_zc1">验证码：</div>
										<div class="r_list wtwo_zc1">
											<input id="verif_code" name="vcode" maxlength="4" type="text"
												class="vali_text" kztype="captcha">
											<div id="verif_codeTip"></div>
										</div>
									</div>
								</div>
							</c:if>


							<div class="reg_line">
								<p class="zc_sfz">
									<span class="fleft">根据《网络游戏管理暂行办法》关于实名注册的规定，请正确填写您的真实姓名与身份证号码</span>
								</p>
							</div>
							<div id="Approve">
								<div class="t_line">
									<div class="l_list wone_zc1">真实姓名：</div>
									<div class="r_list wtwo_zc1">
										<div class="input_text">
											<input id="realname" type="text" maxlength="50"
												name="realname">
										</div>
										<div id="realnameTip"></div>
									</div>
								</div>
								<div class="t_line">
									<div class="l_list wone_zc1">身份证号：</div>
									<div class="r_list wtwo_zc1">
										<div class="input_text">
											<input id="personid" type="text" maxlength="18"
												name="personid">
										</div>
										<div id="personidTip"></div>
									</div>
								</div>
							</div>
							<div class="t_line">
								<div class="l_list wone_zc1">&nbsp;</div>
								<div class="r_list wtwo_zc1">
									<a id="submit_btn" class="btn_10"
										onclick="$('#register_frm').submit();"><span>提交注册</span></a>
								</div>
							</div>
							<div class="t_line">
								<div class="l_list wone_zc1">&nbsp;</div>
								<div class="r_list wtwo succ_send">
									<input id="agreement_chk" type="checkbox" checked
										class="fleft mr15" name="agreement_chk"> <span>我接受</span><span
										class="fblue">《</span><a href="/products/rules.jsp"
										target="_blank" class="fblue">乐控科技用户注册协议</a><span
										class="fblue">》</span>
									<div id="agreement_chkTip"></div>
								</div>
							</div>
						</c:if>
					</div>
				</div>
				<input type="hidden" name="original" id="original" value="1" /> <input
					type="hidden" name="source" id="source" value="" /> <input
					type="hidden" name="regType" id="regType" value="nickname" /> <input
					type="hidden" name="m" id="m" value="toregnickname" />
			</form>
		</div>
	</div>
	<!--底部信息-->

	<div class="reg_footbox">
		<p>
			<span>COPYRIGHT&nbsp;&copy;&nbsp;1998 &ndash; 2015 KONGZHONG.
				ALL RIGHTS RESERVED. </span>乐控科技版权所有
		</p>
		<p>京ICP证020001号&nbsp;京网文[2011]0467&ndash;160号&nbsp;经营许可证编号:B2&ndash;20090197</p>
	</div>

	<div style="display:none">
		<script type="text/javascript">
			var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://"
					: " http://");
			document
					.write(unescape("%3Cscript src='"
							+ _bdhmProtocol
							+ "hm.baidu.com/h.js%3F1287c2225a527abe3386233dd9316f99' type='text/javascript'%3E%3C/script%3E"));
		</script>
	</div>
	<div id="tanc_sj" style="display:none">
		<div class="tc_sj">
			<h3>
				<!-- 				<a class="close" href="javascript:$.KzShowForm.removeBox();"></a> -->
			</h3>
		</div>
	</div>




	<script src="/products/passport/v2/js/jquery.js"></script>
	<script type="text/javascript"
		src="/products/passport/v2/js/kzpassport.js"></script>
	<script type="text/javascript"
		src="/products/passport/v2/js/formValidator413.js"></script>
	<script type="text/javascript">
		$.formValidator.initConfig({
			errorFocus : false,
			formID : "register_frm",
			submitOnce : true,
			forcevalid : false,
			errorfocus : false,
			buttonID : "submit_btn"
		});
		$("#useraccount")
				.formValidator({
					onFocus : tips.${tipsParam}.f
				})
				.inputValidator({
					empty : {
						leftEmpty : false,
						rightEmpty : false,
						emptyError : tips.${tipsParam}.err_kongge
					}
				})
				.regexValidator({
					regExp : "${regParam}",
					dataType : "enum",
					onError : tips.account.err,
					onErrorEmpty : tips.${tipsParam}.err_null
				})
				.ajaxValidator(
						{
							url : "/products/${calibrationUrl}",
							dataType : "json",
							async : true,
							data : {
								"${ajaxParam}" : function() {
									return $("#useraccount").val();
								}
							},
							success : function(data) {
								if (data != "1") {
									if (${registerType} == 1) {
										return tips.${tipsParam}.err_reg;
									} else if (${registerType} == 2) {
										return tips.${tipsParam}.err_reg;
									} else if (${registerType} == 3) {
										return "此邮箱已被占用，<a target=\"_blank\" class=\"fblue\" href=\"/products/passwordback\">点击这里找回密码</a>";
									}
								}
								return true;
							},
							onError : tips.${tipsParam}.err_reg
						});
		$("#password").formValidator({
			onFocus : tips.pwd.f
		}).inputValidator({
			min : 6,
			max : 16,
			empty : {
				leftEmpty : false,
				rightEmpty : false,
				emptyError : tips.pwd.err_kongge
			},
			onError : tips.pwd.err,
			onErrorEmpty : tips.pwd.err_null
		}).regexValidator({
			regExp : "pwd",
			dataType : "enum",
			onError : tips.pwd.err,
			onErrorEmpty : tips.pwd.err_null
		});
		$("#password2").formValidator({
			onFocus : tips.rpwd.f
		}).inputValidator({
			min : 6,
			max : 16,
			empty : {
				leftEmpty : false,
				rightEmpty : false,
				emptyError : tips.rpwd.err_kongge
			},
			onError : tips.pwd.err,
			onErrorEmpty : tips.rpwd.err_null
		}).regexValidator({
			regExp : "pwd",
			dataType : "enum",
			onError : tips.rpwd.err,
			onErrorEmpty : tips.rpwd.err_null
		}).compareValidator({
			desID : "password",
			operateor : "=",
			onError : tips.rpwd.err
		});
		$("#verif_code").formValidator({
			onFocus : tips.captcha.f
		}).inputValidator({
			min : 4,
			max : 4,
			onError : tips.captcha.err,
			onErrorEmpty : tips.captcha.err_null
		}).ajaxValidator({
			url : "/products/checkVCode?" + Math.random(),
			dataType : "text",
			type : "get",
			async : false,
			data : {
				"code" : function() {
					return $("#verif_code").val();
				}
			},
			success : function(data) {
				if (data != "1") {
					$('#re_verif_code_btn').click();
					return tips.captcha.err;
				}
				return true;
			},
			onError : tips.captcha.err
		});
		$("#realname").formValidator({
			onFocus : tips.realname.f
		}).regexValidator({
			regExp : "realname",
			dataType : "enum",
			onError : tips.realname.err,
			onErrorEmpty : tips.realname.err_null
		});
		$("#personid").formValidator({
			onFocus : tips.identityNum.f
		}).functionValidator({
			fun : function() {
				if ($("#realname").val() != "" && $("#personid").val() == "") {
					return tips.identityNum.err_null;
				}
				if ($("#personid").val() != "") {
					return isCardID($("#personid").val());
				}
				return "null";
			}
		}).ajaxValidator({
			dataType : "text",
			data : {
				"idcard" : function() {
					return $("#personid").val();
				}
			},
			url : "/products/checkIdCard",
			success : function(d) {
				switch (d) {
				case "-15":
					tips.msg = "该身份证号已经被占用，请换一个身份证号进行重试！";
					break;
				case "-16":
					tips.msg = "身份证格式不正确！";
					break;
				default:
					return true;
					break;
				}
				return tips.msg;
			},
			onError : function() {
				return tips.msg || "服务器校验失败"
			}
		});

		$("#agreement_chk").formValidator({
			onFocus : "null",
			onCorrect : "null"
		}).functionValidator({
			fun : function() {
				if (!$("#agreement_chk").attr("checked")) {
					return tips.rule.err;
				}
				return true;
			}
		});
		var err_fieldjs = "";
		var err_val_js = "";
		if (err_fieldjs != "") {
			$.formValidator.showTips($("#" + err_fieldjs) + "Tip", "err",
					err_val_js);

			//显示实名认证区域
			$("#Approve").removeClass().addClass("block");
			$("#sfzTab").addClass("open");
		}
		$("#sfzTab").live("click", function() {
			if ($("#Approve").attr("class") == "dnone") {
				$("#Approve").removeClass().addClass("block");
				$("#sfzTab").addClass("open");
			} else {
				$("#Approve").removeClass().addClass("dnone");
				$("#sfzTab").removeClass("open");
			}
		});

		$("#resendemail")
				.bind(
						"click",
						function() {
							var btn = $(this);
							var tips = $("#tips");
							if (tips) {
								tips.remove();
							}
							if (btn.hasClass("nosend")) {
								$(
										"<a id=\"tips\" class=\"fscg fscg_error\">操作过于频繁，请稍后重试！</a>")
										.insertAfter(btn);
								return false;
							} else {
								$
										.getJSON(
												"/products/resendregemail",
												"email="
														+ $("#useraccount")
																.val(),
												function(data) {
													if (data == "1") {
														btn.addClass("nosend");
														$(
																"<a id=\"tips\" class=\"fscg\">邮件已发送成功，请注意查收！</a>")
																.insertAfter(
																		btn);
													} else {
														$(
																"<a id=\"tips\" class=\"fscg_error\">邮件发送失败，请稍后重试！</a>")
																.insertAfter(
																		btn);
														return false;
													}
													window
															.setTimeout(
																	function() {
																		btn
																				.removeClass("nosend");
																	}, 180000);
												});
							}
						});
		$("#sms_code_btn")
				.click(
						function() {
							var phone = $("#useraccount").val();
							if (phone != "") {
								if ($("#useraccountTip").find(".info_cur_erro").length > 0) {
									return false;
								}

								var phone = $("#useraccount").val();
								//异步发送
								$
										.ajax({
											type : 'get',
											url : "/products/regsmscode?t="
													+ Math.random(),
											data : {
												type : 1,
												phone : phone
											},
											dataType : 'text',
											success : function(result) {
												switch (result) {
												case "4085": {
													$.formValidator
															.showTips(
																	$("#useraccountTip"),
																	"err",
																	"短信验证码每个手机号码每天只能发送10条");
												}
													break;
												case "success": {
													var obj = $("#sms_code_btn");
													obj.attr("disabled",
															"disabled").attr(
															"send", "ok");
													obj.val("(59秒)后重新获取");
													var s = 58;
													var Interval = setInterval(
															function() {

																obj
																		.val("("
																				+ s
																				+ "秒)后重新获取");
																s--;
																if (s == 0) {
																	obj
																			.val(
																					"重新获取验证码")
																			.removeAttr(
																					"disabled");
																	clearInterval(Interval);
																}
															}, 1000);
													$.formValidator
															.showTips(
																	$("#vcodeTip"),
																	"focus",
																	"短信验证码已发送");
												}
													break;
												}
											},
											error : function() {
												// 												$.KzShowForm.removeBox();
												$.formValidator.showTips(
														$("#vcodeTip"), "err",
														tips.smscode.err_send);
											}
										});

							} else {
								$.formValidator.showTips($("#useraccountTip"),
										"err", tips.phone.err_null);
								return false;
							}
						});

		$("#vcode").formValidator({
			onFocus : function() {
				if ($("#sms_code_btn").attr("send")) {
					return tips.smscode.f_after;
				} else {
					return tips.smscode.f_befor;
				}
			}
		}).inputValidator({
			min : 6,
			max : 6,
			onError : tips.smscode.err,
			onErrorEmpty : tips.smscode.err_null
		}).ajaxValidator({
			url : "/products/checksmscode",
			dataType : "text",
			async : false,
			data : {
				"phone" : function() {
					return $("#useraccount").val();
				},
				"code" : function() {
					return $("#vcode").val();
				},
				"type" : "regist"
			},
			success : function(data) {
				if (data != "1") {
					return tips.smscode.err;
				}
				return true;
			},
			onError : tips.smscode.err
		});
	</script>
</body>
</html>
